package com.qianli.cashmama.trade.controller.request;

import com.fqgj.common.api.ParamsObject;
import com.fqgj.exception.common.ApplicationException;
import com.fqgj.log.factory.LogFactory;
import com.fqgj.log.interfaces.Log;
import org.apache.commons.lang.StringUtils;

/**
 * Created with IntelliJ IDEA.
 * User: Karl
 * Date: 2020/10/26
 * Time: 上午9:27
 */
public class ArtificialCallbackRequest extends ParamsObject {

    private static final Log LOGGER = LogFactory.getLog(ArtificialCallbackRequest.class);

    private String code;
    private String message;
    private String bizNo;
    private String acceptNo;

    private String currentTime;
    private String tripleAcceptDate;
    private String acceptAmount;
    private String paymentChannelCode;

    private String paymentChannelName;
    private String bizApplyDate;
    private String infoOrder;
    private String fundSiteCode;

    /**
     * 允许重试
     */
    private boolean allowedToRetry;

    private String signature;

    private String timestamp;

    @Override
    public void validate() {
        LOGGER.info("人工还款回调,code:{},msg:{},bizNo:{},acceptNo:{},currentTime:{},tripleAcceptDate:{},acceptAmount:{},paymentChannelCode:{},paymentChannelName:{},bizApplyDate:{},infoOrder:{}",
                code, message, bizNo, acceptNo, currentTime, tripleAcceptDate, acceptAmount, paymentChannelCode, paymentChannelName, bizApplyDate, infoOrder);
        if (StringUtils.isEmpty(bizNo) ||
                StringUtils.isEmpty(acceptNo) ||
                StringUtils.isEmpty(bizApplyDate) ||
                StringUtils.isEmpty(acceptAmount) ||
                StringUtils.isEmpty(paymentChannelCode)
        ) {
            LOGGER.error("人工还款回调参数错误,bizNo:{},acceptNo:{},bizApplyDate:{},acceptAmount:{},paymentChannelCode:{}",
                    bizNo, acceptNo, bizApplyDate, acceptAmount, paymentChannelCode);
            throw new ApplicationException("参数错误");
        }
    }

    public String getCode() {
        return code;
    }

    public ArtificialCallbackRequest setCode(String code) {
        this.code = code;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public ArtificialCallbackRequest setMessage(String message) {
        this.message = message;
        return this;
    }

    public String getBizNo() {
        return bizNo;
    }

    public ArtificialCallbackRequest setBizNo(String bizNo) {
        this.bizNo = bizNo;
        return this;
    }

    public String getAcceptNo() {
        return acceptNo;
    }

    public ArtificialCallbackRequest setAcceptNo(String acceptNo) {
        this.acceptNo = acceptNo;
        return this;
    }

    public String getCurrentTime() {
        return currentTime;
    }

    public ArtificialCallbackRequest setCurrentTime(String currentTime) {
        this.currentTime = currentTime;
        return this;
    }

    public String getTripleAcceptDate() {
        return tripleAcceptDate;
    }

    public ArtificialCallbackRequest setTripleAcceptDate(String tripleAcceptDate) {
        this.tripleAcceptDate = tripleAcceptDate;
        return this;
    }

    public String getAcceptAmount() {
        return acceptAmount;
    }

    public ArtificialCallbackRequest setAcceptAmount(String acceptAmount) {
        this.acceptAmount = acceptAmount;
        return this;
    }

    public String getPaymentChannelCode() {
        return paymentChannelCode;
    }

    public ArtificialCallbackRequest setPaymentChannelCode(String paymentChannelCode) {
        this.paymentChannelCode = paymentChannelCode;
        return this;
    }

    public String getPaymentChannelName() {
        return paymentChannelName;
    }

    public ArtificialCallbackRequest setPaymentChannelName(String paymentChannelName) {
        this.paymentChannelName = paymentChannelName;
        return this;
    }

    public String getBizApplyDate() {
        return bizApplyDate;
    }

    public ArtificialCallbackRequest setBizApplyDate(String bizApplyDate) {
        this.bizApplyDate = bizApplyDate;
        return this;
    }

    public String getInfoOrder() {
        return infoOrder;
    }

    public ArtificialCallbackRequest setInfoOrder(String infoOrder) {
        this.infoOrder = infoOrder;
        return this;
    }

    public String getFundSiteCode() {
        return fundSiteCode;
    }

    public ArtificialCallbackRequest setFundSiteCode(String fundSiteCode) {
        this.fundSiteCode = fundSiteCode;
        return this;
    }

    public boolean isAllowedToRetry() {
        return allowedToRetry;
    }

    public ArtificialCallbackRequest setAllowedToRetry(boolean allowedToRetry) {
        this.allowedToRetry = allowedToRetry;
        return this;
    }

    public String getSignature() {
        return signature;
    }

    public ArtificialCallbackRequest setSignature(String signature) {
        this.signature = signature;
        return this;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public ArtificialCallbackRequest setTimestamp(String timestamp) {
        this.timestamp = timestamp;
        return this;
    }
}
